home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / Framewrk / FWPart / FWIters.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  9.8 KB  |  362 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWIters.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9. //
  10. //    This file contains the following iterators
  11. //
  12. //        - FW_CODFrameFacetIterator
  13. //
  14. //        - FW_CEmbeddedODFacetsIterator
  15. //            Iterates trought all the facets embedded in one of your display facet for a specific proxy.
  16. //            If the embedding facet is NULL,  returns all the embedded facets for a proxy.
  17. //
  18. //        - FW_CFacetIterator
  19. //            Wrapper for ODFacetIterator, safe for exception.
  20. //
  21. //        - FW_CFrameFacetIterator
  22. //            Allows you to iterator through all the facets of a display frame.
  23. //
  24. //        - FW_CPresentationFrameIterator
  25. //
  26. //        - FW_CPresentationFacetIterator
  27. //
  28. //        - FW_CFrameProxyFrameIterator
  29. //
  30. //        - FW_CFrameEmbeddedFrameIterator
  31. //
  32. //        - FW_CFocusSetIterator
  33. //
  34.  
  35. #ifndef FWITERS_H
  36. #define FWITERS_H
  37.  
  38. #ifndef FWSTDDEF_H
  39. #include "FWStdDef.h"
  40. #endif
  41.  
  42. #ifndef FWEXCLIB_H
  43. #include "FWExcLib.h"
  44. #endif
  45.  
  46. #ifndef FWPART_H
  47. #include "FWPart.h"
  48. #endif
  49.  
  50. #ifndef FWPROXY_H
  51. #include "FWProxy.h"
  52. #endif
  53.  
  54. #ifndef FWFRMING_H
  55. #include "FWFrming.h"
  56. #endif
  57.  
  58. #ifndef FWPRESEN_H
  59. #include "FWPresen.h"
  60. #endif
  61.  
  62. #ifndef FWPXYFRM_H
  63. #include "FWPxyFrm.h"
  64. #endif
  65.  
  66. #ifndef FWPRTITE_H
  67. #include "FWPrtIte.h"
  68. #endif
  69.  
  70. #ifndef FWORDCOL_H
  71. #include "FWOrdCol.h"
  72. #endif
  73.  
  74. // ----- OpenDoc Includes -----
  75.  
  76. #ifndef SOM_ODFacetIterator_xh
  77. #include <FacetItr.xh>
  78. #endif
  79.  
  80. #ifndef SOM_ODFocusSetIterator_xh
  81. #include "FocusItr.xh"
  82. #endif
  83.  
  84. #ifndef SOM_ODFrameFacetIterator_xh
  85. #include <FrFaItr.xh>
  86. #endif
  87.  
  88. #ifndef SOM_ODTypeListIterator_xh
  89. #include <TypLsItr.xh>
  90. #endif
  91.  
  92. //========================================================================================
  93. //    Forward Declarations
  94. //========================================================================================
  95.  
  96. class FW_CPart;
  97. class FW_CFrame;
  98. class FW_CEmbeddingFrame;
  99. class FW_CFrameFacetIterator;
  100. class ODFacet;
  101. class ODFrame;
  102.  
  103. //========================================================================================
  104. //    class FW_CODFrameFacetIterator
  105. //========================================================================================
  106.  
  107. class FW_CODFrameFacetIterator
  108. {
  109. public:
  110.     FW_DECLARE_AUTO(FW_CODFrameFacetIterator)
  111.  
  112.     FW_CODFrameFacetIterator(Environment* ev, ODFrame* odFrame);
  113.     virtual ~FW_CODFrameFacetIterator();
  114.  
  115.     ODFacet*        First(Environment* ev)
  116.                         {return fODFrameFacetIte->First(ev);}
  117.     ODFacet*        Next(Environment* ev)
  118.                         {return fODFrameFacetIte->Next(ev);}
  119.     
  120.     FW_Boolean        IsNotComplete(Environment* ev)
  121.                         {return fODFrameFacetIte->IsNotComplete(ev);}
  122.  
  123. private:
  124.     ODFrameFacetIterator     *fODFrameFacetIte;
  125. };
  126.  
  127. //========================================================================================
  128. //    class FW_CFrameFacetIterator
  129. //========================================================================================
  130.  
  131. class FW_CFrameFacetIterator : public FW_CODFrameFacetIterator
  132. {
  133. public:
  134.     FW_DECLARE_AUTO(FW_CFrameFacetIterator)
  135.     
  136.     FW_CFrameFacetIterator(Environment* ev, const FW_CFrame* frame);
  137.     virtual ~FW_CFrameFacetIterator();
  138. };
  139.  
  140. //========================================================================================
  141. //    class FW_CFacetIterator
  142. //========================================================================================
  143.  
  144. class FW_CFacetIterator
  145. {
  146.  
  147. public:
  148.     FW_DECLARE_AUTO(FW_CFacetIterator)
  149.     
  150.     FW_CFacetIterator(Environment* ev, 
  151.                         ODFacet* facet,
  152.                         ODTraversalType traversalType = kODChildrenOnly,
  153.                         ODSiblingOrder siblingOrder = kODFrontToBack);
  154.     ~FW_CFacetIterator();
  155.  
  156.     ODFacet*        First(Environment* ev)
  157.                         {return fODFacetIterator->First(ev);}
  158.     ODFacet*        Next(Environment* ev)
  159.                         {return fODFacetIterator->Next(ev);}
  160.     FW_Boolean        IsNotComplete(Environment* ev)
  161.                         {return fODFacetIterator->IsNotComplete(ev);}
  162.     void            SkipChildren(Environment* ev)
  163.                         {fODFacetIterator->SkipChildren(ev);}
  164.     
  165. private:
  166.     ODFacetIterator         *fODFacetIterator;
  167. };
  168.  
  169. //========================================================================================
  170. //    class FW_CTypeListIterator
  171. //========================================================================================
  172.  
  173. class FW_CTypeListIterator
  174. {
  175. public:
  176.     FW_DECLARE_AUTO(FW_CTypeListIterator)
  177.     
  178.     FW_CTypeListIterator(Environment* ev, ODTypeList* typeList);
  179.     ~FW_CTypeListIterator();
  180.  
  181.     ODType            First(Environment* ev)
  182.                         {return fODTypeListIterator->First(ev);}
  183.     ODType            Next(Environment* ev)
  184.                         {return fODTypeListIterator->Next(ev);}
  185.     FW_Boolean        IsNotComplete(Environment* ev)
  186.                         {return fODTypeListIterator->IsNotComplete(ev);}
  187.     
  188. private:
  189.     ODTypeListIterator*    fODTypeListIterator;
  190. };
  191.  
  192. //========================================================================================
  193. //    class FW_CPresentationFrameIterator
  194. //========================================================================================
  195.  
  196. class FW_CPresentationFrameIterator
  197. {
  198. public:
  199.     FW_DECLARE_AUTO(FW_CPresentationFrameIterator)
  200.     
  201.     FW_CPresentationFrameIterator(Environment* ev, 
  202.                                     FW_CPresentation* presentation);
  203.     FW_CPresentationFrameIterator(Environment* ev, 
  204.                                     FW_CPresentation* presentation, 
  205.                                     ODID frameGroup, 
  206.                                     ODID sequenceNumber);
  207.     ~FW_CPresentationFrameIterator();
  208.  
  209.     FW_CFrame*            First(Environment* ev);
  210.     FW_CFrame*            Next(Environment* ev);
  211.     FW_CFrame*            Last(Environment* ev);
  212.     FW_CFrame*            Previous(Environment* ev);
  213.     FW_Boolean            IsNotComplete(Environment*)
  214.                             {return fCurrentFrame != NULL;}
  215.     
  216. protected:
  217.     FW_CFrame*        GetNext(Environment* ev, FW_CPrivDisplayFrame* displayFrame);
  218.     FW_CFrame*        GetPrevious(Environment* ev, FW_CPrivDisplayFrame* displayFrame);
  219.                                     
  220. private:
  221.     FW_CFrame*                                            fCurrentFrame;
  222.     FW_TOrderedCollectionIterator<FW_CPrivDisplayFrame>    fIterator;
  223.     ODID    fFrameGroup;
  224.     ODID    fSequenceNumber;
  225. };
  226.  
  227. //========================================================================================
  228. //    class FW_CPresentationFacetIterator
  229. //========================================================================================
  230.  
  231. class FW_CPresentationFacetIterator
  232. {
  233. public:
  234.     FW_DECLARE_AUTO(FW_CPresentationFacetIterator)
  235.     
  236.     FW_CPresentationFacetIterator(Environment* ev, FW_CPresentation* presentation);
  237.     ~FW_CPresentationFacetIterator();
  238.  
  239.     ODFacet*        First(Environment* ev);
  240.     ODFacet*        Next(Environment* ev);
  241.     FW_Boolean        IsNotComplete(Environment*)
  242.                         {return fCurrentFacet != NULL;}
  243.  
  244. private:
  245.     ODFacet*        ResetFacetIterator(Environment* ev, FW_CFrame* frame);
  246.     
  247. private:
  248.     FW_CPresentationFrameIterator    fFrameIterator;
  249.     FW_CFrameFacetIterator*            fFacetIterator;
  250.     ODFacet*                        fCurrentFacet;
  251. };
  252.  
  253. //========================================================================================
  254. //    FW_CEmbeddedODFacetsIterator
  255. //========================================================================================
  256.  
  257. class FW_CEmbeddedODFacetsIterator
  258. {
  259. public:
  260.     FW_DECLARE_AUTO(FW_CEmbeddedODFacetsIterator)
  261.     
  262.     FW_CEmbeddedODFacetsIterator(Environment* ev, const FW_MProxy* proxy, ODFacet* embeddingFacet, ODSiblingOrder siblingOrder);
  263.     ~FW_CEmbeddedODFacetsIterator();
  264.  
  265.     ODFacet*        First(Environment* ev);
  266.     ODFacet*        Next(Environment* ev);
  267.     FW_Boolean        IsNotComplete(Environment* ev);
  268.  
  269. private:
  270.     ODFacet*        PrivFindNext(Environment* ev, ODFacet* facet);
  271.     
  272. private:
  273.     ODFacetIterator*    fODFacetIterator;
  274.     ODPart*                fEmbeddedODPart;
  275.     ODID                 fSequenceNumber;
  276.     ODID                fFrameGroup;
  277.     ODFacet*            fODFacet;
  278. };
  279.  
  280. //========================================================================================
  281. //    class FW_CFrameProxyFrameIterator
  282. //========================================================================================
  283.  
  284. class FW_CFrameProxyFrameIterator
  285. {
  286. public:
  287.     FW_DECLARE_AUTO(FW_CFrameProxyFrameIterator)
  288.  
  289.     FW_CFrameProxyFrameIterator(Environment* ev, const FW_CEmbeddingFrame* frame);
  290.     ~FW_CFrameProxyFrameIterator();
  291.  
  292.     FW_CProxyFrame*        First(Environment* ev);
  293.     FW_CProxyFrame*        Next(Environment* ev);
  294.     FW_CProxyFrame*        Last(Environment* ev);
  295.     FW_CProxyFrame*        Previous(Environment* ev);
  296.     FW_Boolean            IsNotComplete(Environment*)
  297.                             {return fCurrentFrame != NULL;}
  298.     
  299. protected:
  300.     FW_CProxyFrame*        GetNext(Environment* ev, FW_MProxy* proxy);
  301.     FW_CProxyFrame*        GetPrevious(Environment* ev, FW_MProxy* proxy);
  302.                                     
  303. private:
  304.     ODID                            fContainerID;
  305.     FW_CProxyFrame*                    fCurrentFrame;
  306.     FW_CPartProxyIterator             fProxyIterator;
  307. };
  308.  
  309. //========================================================================================
  310. //    class FW_CFrameEmbeddedFrameIterator
  311. //========================================================================================
  312.  
  313. class FW_CFrameEmbeddedFrameIterator
  314. {
  315. public:
  316.     FW_DECLARE_AUTO(FW_CFrameEmbeddedFrameIterator)
  317.     
  318.     FW_CFrameEmbeddedFrameIterator(Environment* ev, const FW_CEmbeddingFrame* frame);
  319.     ~FW_CFrameEmbeddedFrameIterator();
  320.  
  321.     ODFrame*        First(Environment* ev);
  322.     ODFrame*        Next(Environment* ev);
  323.     ODFrame*        Last(Environment* ev);
  324.     ODFrame*        Previous(Environment* ev);
  325.     FW_Boolean        IsNotComplete(Environment*)
  326.                         {return fCurrentFrame != NULL;}
  327.  
  328. private:
  329.     ODFrame*        PrivNext(Environment* ev, FW_CProxyFrame* proxyFrame);
  330.     ODFrame*        PrivPrevious(Environment* ev, FW_CProxyFrame* proxyFrame);
  331.                                 
  332. private:
  333.     FW_CFrameProxyFrameIterator     fIterator;
  334.     ODFrame*                        fCurrentFrame;
  335. };
  336.  
  337. //========================================================================================
  338. //    class FW_CFocusSetIterator
  339. //========================================================================================
  340.  
  341. class FW_CFocusSetIterator
  342. {
  343. public:
  344.     FW_DECLARE_AUTO(FW_CFocusSetIterator)
  345.  
  346.     FW_CFocusSetIterator(Environment* ev, const FW_CFrame* frame);
  347.     ~FW_CFocusSetIterator();
  348.     
  349. public:
  350.     ODTypeToken         First(Environment* ev)
  351.                             {return fIterator->First(ev);}
  352.     ODTypeToken         Next(Environment* ev)
  353.                             {return fIterator->Next(ev);}
  354.     FW_Boolean             IsNotComplete(Environment* ev)
  355.                             {return fIterator->IsNotComplete(ev);}
  356.  
  357. private:
  358.     ODFocusSetIterator*        fIterator;
  359. };
  360.  
  361. #endif
  362.